.item {
  display: flex;
  position: relative;
  margin: 25px 0;
  border-radius: 0 3px 3px 0;
  z-index: 10;

  .item-iconContainer {
    left: -1px;
  }
}

.item.rollback,
.item.batch-merge,
.item.merge,
.item.new-slave,
.item.uncorrect-all,
.item.correct-all,
.item.batch-sync,
.item.sync {
  left: 10px;
  width: calc(100% + -9px);
  padding: 5px;
  background: var(--content-background);
  border: 1px solid var(--background-light-highlight);
  border-left: 0;

  .item-iconContainer {
    top: 3px;
    left: -16px;
  }

  .item-content {
    width: 100%;
    padding: 5px 5px 0 2px;
    margin-left: -16px;
    background: var(--content-background);
    border-bottom: 0;
  }
}

.item.batch-sync,
.item.sync {
  position: relative;
  transform: translateX(-1px);
  padding: 6px 10px 5px;
  border-color: transparent;
  border-left: 1px solid var(--color-primary-darken-10);

  &.compact {
    border-left: 1px solid var(--color-primary-darken-10);
  }

  &:before {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    content: '';
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    opacity: 0.16;
    pointer-events: none;
  }

  .item-iconContainer {
    left: -21px;
    background: var(--color-primary);
    border-color: transparent;
    box-shadow: none;
  }

  .item-iconContainer-icon {
    stroke: var(--content-background);
  }

  .item-stats {
    padding: 0;
    background: transparent;
    color: var(--text-color-normal);
  }

  .item-date {
    color: var(--color-black);
  }

  .item-details-link {
    color: var(--color-primary);
  }

  .item-content {
    background: var(--color-primary-lighten-95);
    color: var(--color-primary-darken-50);
  }

  .item-documentPath {
    color: var(--color-primary-darken-30);
  }

  .item-user,
  .item-header-content {
    color: var(--color-primary-darken-30);
  }

  &.compact {
    .item-content {
      padding-left: 0;
    }

    .item-header {
      margin-bottom: 0;
    }

    .item-iconContainer-icon {
      stroke: var(--color-primary);
    }

    .item-user,
    .item-header-content {
      font-size: 12px;
    }
  }
}

.item.rollback {
  background: var(--background-light);
  border: 1px solid var(--background-light-highlight);

  .item-header {
    margin-bottom: 4px;
  }

  .item-iconContainer {
    display: none;
  }

  .item-translationLink {
    margin-top: 2px;
  }

  .item-content {
    padding: 5px 0 0;
    margin: 0;
    background: var(--background-light);
    border-bottom: 0;
  }
}

.item.uncorrect-all {
  .item-iconContainer {
    background: var(--color-error);
    border-color: transparent;
  }

  .item-iconContainer-icon {
    stroke: var(--content-background);
  }

  &.compact {
    .item-iconContainer-icon {
      stroke: var(--color-error);
    }
  }
}

.item.correct-all {
  &.compact {
    .item-iconContainer-icon {
      stroke: var(--color-success);
    }
  }

  .item-iconContainer {
    background: var(--color-success);
    border-color: transparent;
  }

  .item-iconContainer-icon {
    stroke: var(--content-background);
  }
}

.item.document-delete {
  .item-iconContainer {
    background: var(--color-error);
    border-color: transparent;
  }

  .item-iconContainer-icon {
    stroke: var(--content-background);
  }

  &.compact {
    .item-iconContainer-icon {
      stroke: var(--color-error);
    }
  }
}

.item.correct-conflict {
  .item-iconContainer {
    border-color: var(--color-success);
  }

  .item-iconContainer-icon {
    stroke: var(--color-success);
  }
}

.item.uncorrect-conflict {
  .item-iconContainer {
    border-color: var(--color-error);
  }

  .item-iconContainer-icon {
    stroke: var(--color-error);
  }
}

.item.conflict-on-corrected {
  .item-iconContainer {
    border-color: var(--color-error);
  }

  .item-iconContainer-icon {
    stroke: var(--color-error);
  }
}

.item.conflict-on-proposed {
  .item-iconContainer {
    border-color: var(--color-warning);
  }

  .item-iconContainer-icon {
    stroke: var(--color-warning);
  }
}

.item.rollbacked {
  .item-stats,
  .item-translationText,
  .item-actions,
  .item-header {
    opacity: 0.6;
    font-size: 12px;
  }

  .item-translationText {
    padding: 0;
    background: transparent;
  }

  .item-iconContainer {
    background: var(--content-background);
    border-color: var(--content-background-border);
  }

  .item-iconContainer-icon {
    width: 11px;
    height: 11px;
    stroke: var(--content-background-border);
  }

  &.rollback,
  &.batch-merge,
  &.merge,
  &.new-slave,
  &.uncorrect-all,
  &.correct-all {
    border-color: var(--background-light-highlight);

    .item-iconContainer {
      left: -19px;
      top: 6px;
    }
  }

  &.batch-sync,
  &.sync {
    &:before {
      display: none;
    }

    .item-iconContainer {
      left: -19px;
      top: 6px;
    }
  }
}

.item.rollback.compact {
  .item-iconContainer {
    top: -2px;
    left: -13px;
    display: block;
  }

  .item-content {
    margin-left: -20px;
  }
}

.item.rollbacked.compact,
.item.compact {
  width: 100%;
  margin: 12px 0 2px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;

  &:last-of-type {
    .item-content {
      border-bottom: 0;
    }
  }

  .item-stats {
    display: none;
  }

  .item-header {
    font-size: 11px;
    flex-direction: column;
    align-items: flex-start;
  }

  .item-actions {
    margin: 2px 0 0;
    text-align: left;
  }

  .item-content {
    padding-top: 2px;
    background: transparent;
  }

  .item-iconContainer {
    border-color: var(--content-background);
    background: var(--content-background);
  }

  .item-rollback-content {
    margin: 5px 0;
    padding: 5px 10px;
    font-size: 11px;
    background: var(--background-light);
    color: #888;
  }

  .item-content-rollbacked {
    margin-bottom: 1px;
    font-size: 11px;
  }

  .item-translationText {
    display: none;
  }

  .item-translationLink {
    font-size: 11px;
    margin-left: 0;
    margin-top: 0;
  }

  .item-revisionLink {
    font-size: 11px;
  }

  .item-documentPath {
    font-size: 11px;
  }

  .item-user-picture {
    width: 15px;
    height: 15px;
  }

  .item-details-link {
    opacity: 0.7;
  }
}

.item-wrapper {
  display: flex;
  width: 100%;
}

.item-version-tag {
  margin-left: 6px;
  font-size: 11px;
  font-family: var(--font-monospace);
  text-transform: none;
}

.item-iconContainer {
  display: flex;
  position: relative;
  top: 0;
  flex: 0 0 21px;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  margin-right: 10px;
  border-radius: 50%;
  border: 1px solid var(--color-grey);
  box-shadow: 0 0 0 5px var(--content-background);
  background: var(--content-background);
}

.item-iconContainer-icon {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  stroke: var(--color-grey);
}

.item-content {
  flex: 1 1 100%;
  font-size: 13px;
}

.item.compact {
  .item-header {
    flex-direction: column;
  }

  .item-actions {
    min-width: 0;
    text-align: left;
  }
}

.item-header {
  display: flex;
  justify-content: space-between;
  margin: 0 0 10px;
}

.item-header-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  flex: 1 1 auto;
  font-size: 12px;
}

.item-user {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-weight: bold;
  margin-right: 3px;
}

.item-user-picture {
  width: 17px;
  height: 17px;
  margin-right: 5px;
  border-radius: var(--border-radius);
}

.item-translationFromOperationText,
.item-stats,
.item-translationText {
  margin: 5px 0 10px;
  padding: 8px;
  background: var(--background-light);
  font-size: 12px;
  font-style: italic;
}

.item-translationText-text {
  white-space: pre-wrap;
}

.item-batchedOperations {
  display: grid;
  gap: 10px 8px;
  margin-bottom: 10px;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
}

.item-batchedOperations-path {
  margin-left: 3px;
  font-size: 11px;
  font-weight: 600;

  &::after {
    font-weight: 300;
    content: ', ';
  }

  &:last-of-type::after {
    content: '';
  }
}

.item-batchedOperations-item {
  padding: 8px 18px 6px 0;
  font-size: 12px;

  &:last-of-type {
    border-color: transparent;
  }
}

.item-batchedOperations-label {
  font-weight: 600;
  text-decoration: none;
}

.item-batchedOperations-hiddenCount {
  font-size: 11px;
  margin-left: 4px;
}

.item-translationFromOperationText {
  background: transparent;
  padding: 5px 0;
  margin: 10px 0 0;
}

.item-stats-label,
.item-translationText-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: bold;
  font-style: normal;
}

.item-translationText-emptyText {
  color: #ccc;
}

a.item-documentPath {
  text-decoration: none;

  &:focus,
  &:hover {
    text-decoration: underline;
  }
}

.item-documentPath {
  display: inline-block;
  margin-left: 3px;
  color: var(--color-black);
  font-weight: bold;
  font-size: 12px;
}

.item-translationLink {
  display: block;
  flex: 1 0 auto;
  width: 100%;
  margin-top: 5px;
  text-decoration: none;
  font-size: 12px;
  font-weight: bold;
  font-family: var(--font-monospace);
  word-break: break-all;
  transition: 0.2s ease-in-out;
  transition-property: color;
  color: var(--color-primary);

  &:hover,
  &:focus {
    color: var(--color-primary-darken-10);
  }

  &.item-translationLink--removed {
    color: #666;
  }
}

.item-translationLink-prefix {
  display: block;
  font-weight: normal;
  font-size: 11px;
  color: #959595;
}

.item-revisionLink {
  display: inline-block;
  margin-left: 3px;
  text-decoration: none;
  color: var(--color-primary);

  &:hover,
  &:focus {
    text-decoration: underline;
  }
}

.item-actions {
  flex: 0 1 auto;
  margin: 0;
  text-align: right;
}

.item-date {
  opacity: 0.4;
  color: var(--color-black);
  font-size: 11px;
}

.item-stats {
  list-style: none;
  border-radius: var(--border-radius);
}

.item-rollback {
  transition: 0.2s ease-in-out;
  transition-property: opacity, color;
  opacity: 0;
  background: none;
  padding: 0;
  margin: 0 0 0 5px;
  color: var(--color-grey);
  font-size: 11px;

  &:focus,
  &:hover {
    color: var(--background-light-highlight);
    text-decoration: underline;
  }
}

.item-rollback-content {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  background: var(--content-background);
  font-size: 12px;
  font-style: italic;
  color: #5d6863;

  .item-translationLink {
    font-size: 11px;
  }

  .item-details-link {
    font-weight: bold;
  }
}

.item-rollback-user {
  font-weight: bold;
}

.item-details-link {
  padding-left: 6px;
  margin-left: 5px;
  border-left: 1px solid var(--background-light-highlight);
  text-decoration: none;
  color: var(--color-black);
  font-size: 11px;
  font-weight: 500;

  &:focus,
  &:hover {
    text-decoration: underline;
    color: var(--color-primary);
  }
}

.item-content-rollbacked {
  margin-bottom: 6px;
  color: var(--color-error);
  font-size: 12px;
  font-weight: 500;
}
